package com.mysky.client.mvp.audioplayer.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.mysky.client.mvp.audioplayer.event.MDPositionEvent.MDPositionEventHandler;

public class MDPositionEvent extends
		GwtEvent<MDPositionEventHandler> {

	public static final Type<MDPositionEventHandler> TYPE = new Type<MDPositionEventHandler>();

	private final int percent;
	
	public MDPositionEvent(int percent) {
		super();
		this.percent = percent;
	}

	public interface MDPositionEventHandler extends EventHandler {
		void handleEvent(MDPositionEvent event);
	}

	@Override
	public Type<MDPositionEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(MDPositionEventHandler handler) {
		handler.handleEvent(this);
	}

	public int getPercent() {
		return percent;
	}

}